<!-- 添加商户 -->
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit|ie-comp|ie-stand">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
<meta http-equiv="Cache-Control" content="no-siteapp" />
<!--[if lt IE 9]>
<script type="text/javascript" src="lib/html5shiv.js"></script>
<script type="text/javascript" src="lib/respond.min.js"></script>
<![endif]-->
<link rel="stylesheet" type="text/css" href="${baes }/static/hui/static/h-ui/css/H-ui.min.css" />
<link rel="stylesheet" type="text/css" href="${baes }/static/hui/static/h-ui.admin/css/H-ui.admin.css" />
<link rel="stylesheet" type="text/css" href="${baes }/static/hui/lib/Hui-iconfont/1.0.8/iconfont.css" />
<link rel="stylesheet" type="text/css" href="${baes }/static/hui/static/h-ui.admin/skin/default/skin.css" id="skin" />
<link rel="stylesheet" type="text/css" href="${baes }/static/hui/static/h-ui.admin/css/style.css" />
<!--[if IE 6]>
<script type="text/javascript" src="lib/DD_belatedPNG_0.0.8a-min.js" ></script>
<script>DD_belatedPNG.fix('*');</script>
<![endif]-->
<title>添加商户</title>
<link href="lib/webuploader/0.1.5/webuploader.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div class="page-container">
	<form class="form form-horizontal" id="orderlist_form" method="post">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">姓名:</label>
			<div class="formControls col-xs-5 col-sm-3">
				<input type="text" class="input-text newmer" value="" placeholder="请输入姓名" id="" name="nickname">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">账号:</label>
			<div class="formControls col-xs-5 col-sm-3">
				<input type="text" class="input-text newmer" value="" placeholder="请输入手机号码" id="" name="phone">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-2">密码:</label>
			<div class="formControls col-xs-5 col-sm-3">
				<input type="text" class="input-text newmer" value="" placeholder="密码" id="" name="password">
			</div>
		</div>
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
				<button id="submitButton" class="btn btn-primary radius" type="button" id="submitButton"> 保存</button>
				
				<button onclick="removeIframe();" class="btn btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
			</div>
		</div>
	</form>
</div>
 

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="${baes }/static/hui/lib/jquery/1.9.1/jquery.min.js"></script> 
<script type="text/javascript" src="${baes }/static/hui/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="${baes }/static/hui/static/h-ui/js/H-ui.min.js"></script> 
<script type="text/javascript" src="${baes }/static/hui/static/h-ui.admin/js/H-ui.admin.js"></script> <!--/_footer /作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="${baes }/static/hui/lib/jquery.validation/1.14.0/jquery.validate.js"></script> 
<script type="text/javascript" src="${baes }/static/hui/lib/jquery.validation/1.14.0/validate-methods.js"></script> 
<script type="text/javascript" src="${baes }/static/hui/lib/jquery.validation/1.14.0/messages_zh.js"></script> 
<script type="text/javascript" src="${baes }/static/hui/lib/webuploader/0.1.5/webuploader.min.js"></script> 
<script type="text/javascript">
$(document).ready(function(){
	$("#submitButton").click(function(){
		debugger;
		var phone = $("input[name=phone]").val();
		var password = $("input[name=password]").val();
		var nickname = $("input[name=nickname]").val();
		var isCheck = true;
		if(phone==''){
			layer.msg("请输入账号");
			isCheck = false;
			return false;
		}
		if(password==''){
			layer.msg("请输入密码");
			isCheck = false;
			return false;
		}
		if(nickname==''){
			layer.msg('请输入姓名');
			isCheck = false;
			return false;
		}
		if(isCheck==true){
			layer.confirm('确定创建该账号吗?', {icon: 3, title:'提示'}, function(index){
				debugger;
				layer.close(index);
				var data = {
					'phone' : phone,
					'password' : password,
					'nickname' : nickname
				}
				$.ajax({
		        	url:"${pageContext.request.contextPath}/admin/register/business",
		            type:'post',
		            dataType:'json',
		            data:data,
		            success:function(res)
		            {
		                if(res.code==1){
		                	layer.msg(res.msg, {icon: 1});
		                }else{
		                	layer.msg(res.msg, {icon: 5});
		                }
						$("#orderlist_form")[0].reset();
						
		            }
		        });
		        return false;
			});
		}
	});
});
</script>
</body>
</html>